from config import sleep, driver
from my_config import STEPS
import logging

@STEPS.step('click')
def click(driver:driver, step:dict) -> None:
    """
    单击指定元素
    """
    e = driver.find_element(step['location']['type'], step['location']['val'])
    
    try:
        e.click()
    except:
        logging.error(step)
        raise Exception()